package com.ruoyi.system.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.PWareHouse;
import com.ruoyi.system.mapper.PWareHouseMapper;
import com.ruoyi.system.service.IPWareHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 库房管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-31
 */
@Service
public class PWareHouseServiceImpl extends ServiceImpl<PWareHouseMapper, PWareHouse> implements IPWareHouseService{
    /**
     * 查询库房管理
     * 
     * @param id 库房管理主键
     * @return 库房管理
     */
    @Override
    public PWareHouse selectPWareHouseById(Long id)
    {
        return baseMapper.selectPWareHouseById(id);
    }

    /**
     * 查询库房管理列表
     * 
     * @param pWareHouse 库房管理
     * @return 库房管理
     */
    @Override
    public List<PWareHouse> selectPWareHouseList(PWareHouse pWareHouse)
    {
        return baseMapper.selectPWareHouseList(pWareHouse);
    }

    /**
     * 新增库房管理
     * 
     * @param pWareHouse 库房管理
     * @return 结果
     */
    @Override
    public int insertPWareHouse(PWareHouse pWareHouse)
    {
        pWareHouse.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertPWareHouse(pWareHouse);
    }

    /**
     * 修改库房管理
     * 
     * @param pWareHouse 库房管理
     * @return 结果
     */
    @Override
    public int updatePWareHouse(PWareHouse pWareHouse)
    {
        pWareHouse.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updatePWareHouse(pWareHouse);
    }

    /**
     * 批量删除库房管理
     * 
     * @param ids 需要删除的库房管理主键
     * @return 结果
     */
    @Override
    public int deletePWareHouseByIds(Long[] ids)
    {
        return baseMapper.deletePWareHouseByIds(ids);
    }

    /**
     * 删除库房管理信息
     * 
     * @param id 库房管理主键
     * @return 结果
     */
    @Override
    public int deletePWareHouseById(Long id)
    {
        return baseMapper.deletePWareHouseById(id);
    }

    @Override
    public PWareHouse selectPWareHouseByCode(String code) {
        return baseMapper.selectPWareHouseByCode(code);
    }
}
